package com.itqf.ipmsys.controller;


import com.baomidou.mybatisplus.extension.api.R;
import com.itqf.ipmsys.dto.PoliceSituationDto;
import com.itqf.ipmsys.service.PoliceSituationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 警情表 前端控制器
 * </p>
 *
 * @author corn
 * @since 2021-09-22
 */
@CrossOrigin("*")
@RestController
@RequestMapping("/policesituation")
public class PoliceSituationController {

    @Autowired
    private PoliceSituationService policeSituationService;

    @PostMapping(value = "list", produces = "application/json;charset=utf-8")
    public Object list(@RequestBody PoliceSituationDto policeSituationDto) {
        Object data = policeSituationService.findAllPoliceSituationService(policeSituationDto);
        return R.ok(data).setCode(200);
    }

    @GetMapping(value = "detail")
    public Object selectOne(Integer id) {

        Object data = policeSituationService.findOnePoliceSituationService(id);

        return com.itqf.ipmsys.utils.R.ok().setData("policesituation",data);
    }

}

